Probabilistic Deep Learning: With Python, Keras and TensorFlow Probability - mobi by Oliver Dürr & Beate Sick & Elvis Murina
Author:Oliver Dürr & Beate Sick & Elvis Murina
Language: eng
Format: mobi
Publisher: Manning Publications Co.
Published: 2020-11-08T23:00:00+00:00
def NLL(y, distr):
return -distr.log_prob(y) â¶
def my_dist(params): â·
return tfd.Normal(loc=params, scale=1)
# set the sd to the fixed value 1
inputs = Input(shape=(1,))
params = Dense(1)(inputs) â¸
dist = tfp.layers.DistributionLambda(my_dist)(params) â¹
model_sd_1 = Model(inputs=inputs, outputs=dist) âº
model_sd_1.compile(Adam(), loss=NLL) â»
â¶ Computes the NLL of an observed y under the fitted distribution distr
â· Uses the output of the last layer (params) as the parameter(s) of a distribution
⸠Sets up the NN with one output node
â¹ Calls a distributional layer to take the function my_dist with the argument params
⺠Connects the output of the NN with a distribution
â» Compiles the model with NLL as a loss function
With the TFP code in listing 5.2, youâve fitted a linear regression model. But is it a probabilistic model? A probabilistic model needs to provide a whole CPD for the output for each input x. In the case of a Gaussian CPD, this not only requires an estimated mean μ x but also a standard deviation Ï. In the standard linear regression case, a constant variance is chosen independently of the x position. In this case, we can estimate Ï2 by the variance of the residuals. This means you first need to fit the linear model before you can determine the variance that is used for all CPDs.
Now youâre ready to use the trained model to do some probabilistic predictions on your validation data. For each test point, youâll predict a Gaussian CPD. To visualize how the model performs on the validation data, you can draw the validation data along with the predicted mean of the CPD, μ x(see the solid line in figure 5.4), and the mean plus/minus two times the standard deviation of the CPD, μxi ± 2 â Ïx corresponding to the 0.025 and 0.975 quantiles (see the dashed lines in figure 5.4).
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Personalized inhaled bacteriophage therapy for treatment of multidrug-resistant Pseudomonas aeruginosa in cystic fibrosis by unknow(157789)
Whisky: Malt Whiskies of Scotland (Collins Little Books) by dominic roskrow(74281)
CONSORT 2025 statement: updated guideline for reporting randomized trials by unknow(66082)
Critical evaluation of the ProfiLER-02 study design and outcomes by Vivek Subbiah & Razelle Kurzrock(65833)
Cardiac gene therapy makes a comeback by Oliver J. Müller & Susanne Hille & Anca Kliesow Remes(65271)
Unveiling the design rules for tunable emission in graphene quantum dots: A high-throughput TDDFT and machine learning perspective by Şener Özönder & Mustafa Coşkun Özdemir & Caner Ünlü(50860)
A yeast-based oral therapeutic delivers immune checkpoint inhibitors to reduce intestinal tumor burden by unknow(40225)
Covalent hitchhikers guide proteins to the nucleus by Alexander F. Russell & Madeline F. Currie & Champak Chatterjee(40191)
Meet the Authors: Christopher R. Mansfield and Emily R. Derbyshire by Christopher R. Mansfield & Emily R. Derbyshire(40057)
What's Done in Darkness by Kayla Perrin(27108)
Topological analysis of non-conjugated ethylene oxide cored dendrimers decorated with tetraphenylethylene: Insights from degree-based descriptors using the polynomial approach by A Theertha Nair & D Antony Xavier & Annmaria Baby & S Akhila(26484)
Investigation of mechanical and self-healing properties of hydroxyl-terminated polybutadiene functionalized with 2-ureido-4-pyrimidinone by Mohsen Kazazi & Mehran Hayaty & Ali Mousaviazar(26435)
The Ultimate Python Exercise Book: 700 Practical Exercises for Beginners with Quiz Questions by Copy(21018)
De Souza H. Master the Age of Artificial Intelligences. The Basic Guide...2024 by Unknown(20777)
D:\Jan\FTP\HOL\Work\Alien Breed - Tower Assault CD32 Alien Breed II - The Horror Continues Manual 1.jpg by PDFCreator(20650)
The Fifty Shades Trilogy & Grey by E L James(19605)
Shot Through the Heart: DI Grace Fisher 2 by Isabelle Grey(19487)
Shot Through the Heart by Mercy Celeste(19349)
Python GUI Applications using PyQt5 : The hands-on guide to build apps with Python by Verdugo Leire(17492)